<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>hello vue组件-全局组件</title>
    <link rel="stylesheet" type="text/css" href="./lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./css/vue2-animate.css" type="text/css">

    <script type="text/javascript" src="./lib/vue/vue.js"></script>
    <script type="text/javascript" src="./lib/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/bootstrap/js/bootstrap.js"></script>
    <style>

    </style>

</head>

<body>
    
    <div id="box" class="container" style="margin-top:50px;">
        <parent>
            <ul class="list-group">
                <li class="list-group-item active">Active item</li>
                <li class="list-group-item">Item</li>
                <li class="list-group-item disabled">Disabled item</li>
            </ul>
        </parent>

        <parent>
        </parent>
    </div>

    <!-- 父组件  -->
    <template id="parent">
        <div>
            <span style="color:red;">{{pmessage}}, {{age}}</span><br>
            <slot>默认数据区域</slot>
        </div>
    </template>
</body>


<script>
    var v = new Vue({
        el: '#box',
        components: {
            'parent': {
                template: '#parent', // 关联template标签中的ID属性
                data() {
                    return {
                        pmessage: '我是父组件数据',
                        age: 33,
                    }
                }
            }
        }

    });
</script>

</html>